Optimal. Leaf size=29 \[ -a x-\frac {a \cot (c+d x)}{d}+\frac {b \log (\sin (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3610, 3612,
3556} \begin {gather*} -\frac {a \cot (c+d x)}{d}-a x+\frac {b \log (\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3610
Rule 3612
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+b \tan (c+d x)) \, dx &=-\frac {a \cot (c+d x)}{d}+\int \cot (c+d x) (b-a \tan (c+d x)) \, dx\\ &=-a x-\frac {a \cot (c+d x)}{d}+b \int \cot (c+d x) \, dx\\ &=-a x-\frac {a \cot (c+d x)}{d}+\frac {b \log (\sin (c+d x))}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 0.13, size = 51, normalized size = 1.76 \begin {gather*} -\frac {a \cot (c+d x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};-\tan ^2(c+d x)\right )}{d}+\frac {b (\log (\cos (c+d x))+\log (\tan (c+d x)))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 33, normalized size = 1.14
method | result | size |
derivativedivides | \(\frac {a \left (-\cot \left (d x +c \right )-d x -c \right )+b \ln \left (\sin \left (d x +c \right )\right )}{d}\) | \(33\) |
default | \(\frac {a \left (-\cot \left (d x +c \right )-d x -c \right )+b \ln \left (\sin \left (d x +c \right )\right )}{d}\) | \(33\) |
risch | \(-i b x -a x -\frac {2 i b c}{d}-\frac {2 i a}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) | \(56\) |
norman | \(\frac {-\frac {a}{d}-a x \tan \left (d x +c \right )}{\tan \left (d x +c \right )}+\frac {b \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(57\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 48, normalized size = 1.66 \begin {gather*} -\frac {2 \, {\left (d x + c\right )} a + b \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \, b \log \left (\tan \left (d x + c\right )\right ) + \frac {2 \, a}{\tan \left (d x + c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 59 vs.
\(2 (29) = 58\).
time = 1.21, size = 59, normalized size = 2.03 \begin {gather*} -\frac {2 \, a d x \tan \left (d x + c\right ) - b \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right ) + 2 \, a}{2 \, d \tan \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 70 vs.
\(2 (24) = 48\).
time = 0.35, size = 70, normalized size = 2.41 \begin {gather*} \begin {cases} \tilde {\infty } a x & \text {for}\: \left (c = 0 \vee c = - d x\right ) \wedge \left (c = - d x \vee d = 0\right ) \\x \left (a + b \tan {\left (c \right )}\right ) \cot ^{2}{\left (c \right )} & \text {for}\: d = 0 \\- a x - \frac {a}{d \tan {\left (c + d x \right )}} - \frac {b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {b \log {\left (\tan {\left (c + d x \right )} \right )}}{d} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 83 vs.
\(2 (29) = 58\).
time = 0.58, size = 83, normalized size = 2.86 \begin {gather*} -\frac {2 \, {\left (d x + c\right )} a + 2 \, b \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right ) - 2 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.10, size = 70, normalized size = 2.41 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-\frac {b}{2}+\frac {a\,1{}\mathrm {i}}{2}\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (\frac {b}{2}+\frac {a\,1{}\mathrm {i}}{2}\right )}{d}+\frac {b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}-\frac {a\,\mathrm {cot}\left (c+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________